package vivo.com.foolishbar.core.warp.page;

import java.util.ArrayList;
import java.util.Collection;

import com.wideplay.warp.annotations.URIMapping;
import com.wideplay.warp.persist.Transactional;
import com.wideplay.warp.persist.dao.Finder;

@URIMapping("/blogs")
//@Singleton
public class ListBlogs {
	// private final Map<String, Blog> blogs = new HashMap<String, Blog>();

	private Blog blog;

	public ListBlogs() {
//		 setup a blog as dummy data
//		 blog = new Blog("MyBlog", "Warp is so great...");
//		 blogs.put(blog.getSubject(), blog);
	}

	/*
	 * Methods
	 */
//	public Blog getBlog(String subject) {
//		return blogs.get(subject);
//	}

//	public void addNewBlog(Blog blog) {
//		blogs.put(blog.getSubject(), blog);
//	}

	@Transactional
	@Finder(query = "from Blog", returnAs = ArrayList.class)
	public Collection<Blog> getBlogList() {
		// return blogs.values();
		return null;
	}
}